FILE = main
GREP = grep
RRWARN = "Rerun to get cross-references right"
LOGFILE = $(FILE).log

BIBFILES = ip.bib

all: $(FILE).ps $(FILE).pdf

$(FILE).dvi: *.tex $(FILE).bbl

%.dvi:%.tex
	pslatex $< 
	pslatex $<

%.aux:%.tex
	pslatex $<
	pslatex $<

%.ps:%.dvi
	dvips -o $@ $<
	mv $@ ip.ps

%.pdf:%.dvi
	dvipdfm $<
	mv $@ ip.pdf

$(FILE).bbl: $(BIBFILES) $(FILE).aux
	bibtex $(FILE)

clean::
	rm *aux *log *dvi *bbl *blg *toc *out

dist-clean:: clean
	rm *.ps *.pdf
